Repository navigation
test(conversions): test invariant of feetToMeter with 100 bounded cases (R50-T044) - #92
Open
aniruddha-bongale wants to merge 1 commit into
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses task R50-T044 for
feetToMeter. It introduces invariant and property-based regression tests across 100 bounded valid inputs generated with a deterministic seed, verifies the constant scale ratio, round-trip invertibility, linearity, and monotonicity invariants, documents the mathematical contract next tofeetToMeterinConversions/MeterToFeetConversion.js, and adds an automated check runnerwork/R50-T044/check.pythat confirms sensitivity against deliberately broken mutants.Related Issue
Fixes: #44
Type of Change
Changes Made
feetToMeterinConversions/MeterToFeetConversion.jsciting precondition checks at Line 18.Conversions/test/MeterToFeetConversion.test.js:0feet ->0meters) and ordinary input (10feet ->3.048meters).[0.01, 1000.0].Math.abs(feetToMeter(x)/x - 0.3048) < 1e-12), round-trip invertibility withmeterToFeet(< 1e-9), linearity/additivity (feetToMeter(a+b) === feetToMeter(a) + feetToMeter(b)), and strict monotonicity.work/R50-T044/check.pywith mutant detection verification and saved verifiable results inwork/R50-T044/results.json.Screenshots / Recordings
N/A (Unit / property test suite)
Testing
npx prettier --check Conversions/MeterToFeetConversion.js Conversions/test/MeterToFeetConversion.test.js work/R50-T044/results.jsonnpm test -- Conversions/test/MeterToFeetConversion.test.js(9 tests passed)python3 work/R50-T044/check.py(all checks and tool version captures passed)Checklist
Additional Notes